package cn.broadmax.boot.modules.sys.service.impl;

import cn.broadmax.boot.modules.sys.entity.SysDepartment;
import cn.broadmax.boot.modules.sys.service.ISysDepartmentService;
import cn.broadmax.boot.modules.sys.mapper.SysDepartmentMapper;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 部门 服务实现类
 * </p>
 *
 * @author jexx
 * @since 2021-05-17
 */
@Service
public class SysDepartmentServiceImpl extends ServiceImpl<SysDepartmentMapper, SysDepartment> implements ISysDepartmentService {

    @Override
    public SysDepartment getDepartmentByCode(String orgCode) {
        LambdaQueryWrapper<SysDepartment> wrapper = new LambdaQueryWrapper<>();
        wrapper.eq(SysDepartment::getOrgCode, wrapper);
        return super.getOne(wrapper);
    }

}
